<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.knowledge.model.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<title>知识列表</title>
		<link href="css/layout.css" type="text/css" rel="stylesheet" media="all">
		<link href="css/html.css" type="text/css" rel="stylesheet" media="all">
		<link href="css/blog.css" type="text/css" rel="stylesheet" media="all">
		<link href="css/header.css" rel="stylesheet" type="text/css" />

	<style>
	.blog-home{float:left;width:700px;clear:both;}
	input,label,span,select,h2,h3,p,a,strong{text-align:left}
	.section-header,.text-article{text-align:left}
	</style>

	</head>
	<%	String userId = (String)request.getAttribute("userId");
		List<Knowledge> knowledgelist = (List<Knowledge>) request.getAttribute("knowledgelist");
	%>
	<body id="blogindex">
	<jsp:include page="header.jsp"></jsp:include>
	<center>
		<div id="opi" class="page-wrapper clearfix">
			<div class="full-page-holder">
				<div class="full-page clearfix">
					<div class="main-page">
					<div class="section-header">
<div class="section-avatar">
<a href="<%="home.action?userId="+userId%>" ><img src="<%="avatar/avatar_"+userId+".jpg"%>" /></a>
</div>

<strong><a href="knowledgeedit.action?userId=${requestScope.userId }">添加新知识</a></strong>

</div>
						<div class="blog-home">
							<%
								if(knowledgelist != null){
								Iterator<Knowledge> it = knowledgelist.iterator();
								while (it.hasNext()) {
										Knowledge knowledge = it.next();
							%>
							<div class="list-box">
								<div class="marginleft">
									<h3 class="title-article">
										<div class="share-actions">
										</div>
										<strong> <a
											href="viewknowledge.action?knowledgeId=<%=knowledge.getId()%>&userId=${requestScope.userId}&user=${requestScope.user }"><%=knowledge.getTitle()%></a>
										 </strong>
										<a class="author" href=""><%=knowledge.getUsername()%></a>
										<span class="timestamp"><%=knowledge.getAddData()%></span>
									</h3>

									<div class="text-article">
										&nbsp;&nbsp;&nbsp;&nbsp;
										<%=knowledge.getSummary()%></div>
									<div class="full_listfoot">
									</div>
									<p class="stat-article bottom-margin">
										<a
											href="viewknowledge.action?knowledgeId=<%=knowledge.getId()%>&userId=${requestScope.userId}&user=${requestScope.user }">阅读</a>
										<span class="pipe">|</span>
										<a href="">评论</a>
									</p>
								</div>
							</div>
							<%
								}
								}
							%>
						</div>
					</div>
				</div>
			</div>
		</div>
	<jsp:include page="footer.jsp"></jsp:include>
	</center>
	</body>
</html>
